package com.lixin.springcloud.controller;

import com.lixin.springcloud.entities.CommonResult;
import com.lixin.springcloud.entities.Payment;
import com.lixin.springcloud.service.OpenFeignPaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OpenFeignOrderController {

    @Autowired
    private OpenFeignPaymentService openFeignPaymentService;

    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id) {
        return openFeignPaymentService.getPaymentById(id);
    }

    @GetMapping("/consumer/payment/timeout")
    public String paymentTestTimeout() {
        return openFeignPaymentService.paymentTestTimeout();
    }

    @GetMapping("/consumer/payment/zipkin")
    public String paymentZipkin() {
        return openFeignPaymentService.paymentZipkin();
    }

}
